refactor: replace isDark conditional logic with Tailwind dark: prefix across 19 components (250+ conversions)#240
Merged
zhangxuhe1 merged 11 commits intomainfrom Aug 22, 2025
Merged
Conversation
Collaborator
|
@copilot use pnpm instead of npm. please fix all isDark to dark prefix. Read the comments in relative issue, ensure pnpm format:check and pnpm lint-staged is successful when you want to commit the git.Do not edit about and admin/content pages and components. |
…tion-bar component Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…tion-history component Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…ing-controller and input-area components Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…tion-bar component Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] refactor: replace isDark conditional logic with Tailwind dark: prefix across codebase
refactor: replace isDark conditional logic with Tailwind dark: prefix across codebase
Aug 20, 2025
…n chatflow-node-tracker, image-preview, text-generation-tracker, and audio-preview components Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…n all file-preview components (text, video, pdf, markdown) Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
…viewer, history components, and mobile UI components Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
Copilot
AI
changed the title
refactor: replace isDark conditional logic with Tailwind dark: prefix across codebase
refactor: replace isDark conditional logic with Tailwind dark: prefix across 19 components (250+ conversions)
Aug 20, 2025
…le and history components - Replace remaining false conditional logic with Tailwind dark: prefix in history-selection-bar - Complete mobile user button dark mode implementation with proper dark: classes - Fix user bottom sheet dark mode styling consistency - Clean up unused variables in api-config-store for better code quality - Ensure all dark mode styles use semantic Tailwind classes instead of conditional logic This completes the dark mode refactoring for mobile UI components and history selection bar, providing consistent dark theme support across the application.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR systematically replaces runtime isDark conditional logic with Tailwind CSS's dark: prefix pattern across 19 components, improving performance and maintainability while following Tailwind CSS v4 best practices.
Key Changes:
- Eliminated
useTheme()anduseThemeColors()hook dependencies from all converted components - Replaced conditional class generation with static Tailwind dark mode classes
- Removed
isDarkparameters from component interfaces where applicable
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/stores/api-config-store.ts | Removed unused variable assignments for clean code |
| components/workflow/workflow-tracker/execution-bar.tsx | Converted complex workflow execution status styling with 25+ conversions |
| components/workflow/execution-history/index.tsx | Replaced theme hook usage with dark mode classes |
| components/text-generation/text-generation-viewer.tsx | Updated text generation interface styling |
| components/text-generation/text-generation-tracker.tsx | Converted markdown rendering and streaming indicators |
| components/mobile/ui/user-bottom-sheet.tsx | Updated mobile user interface with 13+ conversions |
| components/mobile/mobile-user-button.tsx | Simplified mobile navigation button styling |
| components/history/index.tsx | Updated main history page styling |
| components/history/history-selection-bar.tsx | Converted selection interface styling |
| components/history/history-list.tsx | Heavy refactoring with 15+ conditional statements |
| components/file-preview/previews/* | Updated all 6 file preview components |
| components/chatflow/chatflow-node-tracker.tsx | Converted real-time node progress display |
| components/chatflow/chatflow-input-area.tsx | Complex form fields with 22+ conversions |
| components/chatflow/chatflow-floating-controller.tsx | Simple floating button component |
| components/chatflow/chatflow-execution-bar.tsx | Advanced component with 30+ conversions and interface refactoring |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lyzno1
approved these changes
Aug 22, 2025
zhangxuhe1
approved these changes
Aug 22, 2025
pixelsama
pushed a commit
to pixelsama/agentifui
that referenced
this pull request
Aug 22, 2025
… across 19 components (250+ conversions) (iflabx#240) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zhangxuhe1 <xuhezhang6@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR systematically replaces runtime
isDarkconditional logic with Tailwind CSS'sdark:prefix pattern across 19 components, addressing performance and maintainability issues while following Tailwind CSS v4 best practices.Problem
The codebase was using runtime
useTheme()hooks withisDarkconditional logic throughout components for dark mode theming:This created several issues:
useTheme()added runtime checksSolution
Replaced all conditional logic with Tailwind's
dark:prefix pattern:Components Converted (19 total)
Workflow Components (2)
workflow-tracker/execution-bar.tsx- Complex execution bars with status indicatorsexecution-history/index.tsx- Mixed theme colors and conditional patternsChatflow Components (3)
chatflow-floating-controller.tsx- Simple floating button componentchatflow-input-area.tsx- Complex form fields with gradients and error states (22+ conversions)chatflow-execution-bar.tsx- Advanced component with sub-components requiring interface refactoring (30+ conversions)chatflow-node-tracker.tsx- Real-time node progress display with complex conditional stylingFile Preview Components (6)
file-preview/previews/image-preview.tsx- Image display with download functionalityfile-preview/previews/audio-preview.tsx- Audio player interface with metadata displayfile-preview/previews/text-preview.tsx- Text content viewer with copy/download actionsfile-preview/previews/video-preview.tsx- Video player with controls and file informationfile-preview/previews/pdf-preview.tsx- PDF document viewer with embedded displayfile-preview/previews/markdown-preview.tsx- Markdown renderer with syntax highlightingText Generation Components (2)
text-generation/text-generation-tracker.tsx- Most complex component with markdown rendering, streaming indicators (25+ conversions)text-generation/text-generation-viewer.tsx- Text display and editing interface (17+ conversions)History & Mobile Components (6)
history/index.tsx- Main history page with search and conversation managementhistory/history-list.tsx- Heavy usage with 15+ conditional statements for list stylinghistory/history-selection-bar.tsx- Selection interface for batch operationsmobile/ui/user-bottom-sheet.tsx- Mobile user interface (13+ conversions)mobile/mobile-user-button.tsx- Mobile navigation button stylingRefactoring Patterns Applied
useTheme()anduseThemeColors()dependencies from 19 componentsisDarkparameters from component interfaces where neededBenefits Achieved
Technical Details
isDarkconditional statementsisDarkreferences left in non-admin/non-about componentspnpm format:checkandpnpm lint-stagedvalidationsTesting
pnpm type-check)The refactoring maintains exact visual appearance and functionality while following Tailwind CSS best practices for significantly better performance and maintainability.
Fixes #220.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.